/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package upeu.cepre.business;

import com.mysql.jdbc.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import upeu.cepre.model.Detalleperiodosede;
import upeu.cepre.util.DataBaseConexion;

public class DetalleperiodosedeManager {

    Detalleperiodosede to = new Detalleperiodosede();
    private Connection connection;
//    public Lis<> Report() {
//    }
//
//    public void Insert() {
//    }
//
//    public void Update() {
//    }
//
//    public void Delete() {
//    }

    /*
     * Metodos Complementarios
     */
    public Detalleperiodosede FindId(String IdDetallePeriodoSede) {
        try {
            connection = (Connection) DataBaseConexion.getConexion();
            Statement statement = connection.createStatement();
            PreparedStatement prepareestatemente = connection.prepareStatement("SELECT * From detalleperiodosede WHERE idDetallePeriodoSede=?  ");
            prepareestatemente.setString(1, IdDetallePeriodoSede);
            ResultSet rs = prepareestatemente.executeQuery();

            if (rs.next()) {

                to.setIdDetallePeriodoSede(rs.getString("idDetallePeriodoSede"));
                to.setIdPeriodo(rs.getString("idPeriodo"));
                to.setIdSede(rs.getString("idSede"));
 
            }
            connection.close();
            statement.close();
            prepareestatemente.close();
            rs.close();
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return to;
    }
//
//    public void ObtenerId() {
//    }
}
